class MessageListModel {
  String name;
  String head;
  String token;
  bool read;
  List<MessageModel> list;

  MessageListModel({this.name, this.head, this.token, this.read:false, this.list});

  MessageListModel.fromJson(Map<String, dynamic> json) {
    name = json['name'];
    head = json['head'];
    token = json['token'];
    read = json['read'];
    if (json['list'] != null) {
      list = new List<MessageModel>();
      json['list'].forEach((v) {
        list.add(new MessageModel.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['name'] = this.name;
    data['head'] = this.head;
    data['token'] = this.token;
    data['read'] = this.read;
    if (this.list != null) {
      data['list'] = this.list.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class MessageModel {
  DateTime time;
  String msg;
  int account;

  MessageModel({this.time, this.msg, this.account});

  MessageModel.fromJson(Map<String, dynamic> json) {
    time = json['time'];
    msg = json['msg'];
    account = json['account'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['time'] = this.time;
    data['msg'] = this.msg;
    data['account'] = this.account;
    return data;
  }
}
